﻿@using FCZLM.Core.Models
@using Microsoft.AspNetCore.Http
@{
    var shoppingcart = ViewBag.ShoppingCart as List<ShoppingCart>;
    var product= ViewBag.Product as List<Products>;
    var producturl = ViewBag.ProductUrl as List<ProductUrls>;
}
<link href="~/layui/css/layui.css" rel="stylesheet" />
<link href="~/css/css.css" rel="stylesheet" />
<link href="~/css/site.css" rel="stylesheet" />
<link href="~/carts/cart/reset.css" rel="stylesheet" />
<script src="~/layui/layui.js"></script>
<script src="~/carts/cart/jd.js"></script>

<div class="pnt">
   <div class="pntLeft">
    <h2 class="Title">购物车
    </h2>
   </div><!--pntLeft/-->
   <div class="pntRight">
    <ul class="nav">
     <li><a href="/home/index">商城首页</a></li>
     <li><a href="/product/index">商品中心</a></li>
     <li><a href="/news/index">新闻中心</a></li>
    <li> @if(@Context.Session.GetString(key:"user")==null){
							 <a href="/login/index">用户中心</a>
						}else{
							
							 <a href="/user/index">用户中心</a>
							
						}  </li>
                        <li><a href="/contact/index">联系我们</a></li>
     <div class="clears"></div>
     <div class="phone">TEL：021-12345678</div>
    </ul><!--nav/-->
   </div><!--pntRight/-->
   <div class="clears"></div>
  </div><!--pnt/-->
  <div class="carImg" style="margin-top:50px"><img src="~/images/car1.jpg" width="961" height="27" /></div>

   <div class="tips warp" style="margin-top:20px">
        <ul>
            <li>
                <input type="checkbox" name="fav" id="all" onclick="checkTest1(this),checkTest2()" />
                全选
            </li>
            <li style="padding-left:60px">商品</li>
            <li style="margin-left:280px">单价</li>
            <li>数量</li>

            <li>小计</li>
            <li>操作</li>
        </ul>

    </div>
 <!--显示菜单的结束-->
    <!--商品详情展示开始-->

        @foreach(var shop in shoppingcart)
{
    <div class="info warp">

        <ul>
            <li class="info_1"><input type="checkbox" name="fav" onclick="checkTest2()" /> </li>

            <li class="info_2">
                <img src="@shop.ProductUrl" style="width:80px;height:80px" />

            </li>
            <li class="info_3" ><a>@shop.Product.Name</a></li>

           <li class="info_4"></li>
            <li class="info_5">@shop.Price</li>

            <li class="info_6">

                <button onclick="checkTest3(this,1),checkTest2()">-</button>

                <input type="text" name="" id="" value="@shop.Num" />

                <button class="bot" onclick="checkTest3(this,2),checkTest2()">+</button>
            </li>
            <li class="info_7" style="width:100px">￥@shop.Subtotal</li>
            <li style="margin-left:30px">
                <a href="javascript:viod(0)" onclick="checkTest4(this),checkTest2()">删除</a><br />
               
            </li>
        </ul>

    </div>
}

<!--商品详情展示结束-->
    <!--结算开始-->
    <div class="balance warp">

        <ul class="balance_ul1">
            <li>

                <input type="checkbox" name="fav" id="" value="" onclick="checkTest1(this),checkTest2()" />
                全选
            </li>
        </ul>
        <ul class="balance_ul2">
            <li>已经选择<span id="snum">0</span>件商品</li>
            <li>总价 <span id="zongz">0</span></li>
            <li>
                <button id="submit" type="submit" class="butt" >去下单</button>
            </li>
        </ul>
 </div>
 <!--结算结束-->
 <script>
     //layui.use(function(){
     //       var $=layui.$;
           
     //       $("#submit").click
     //       (
     //           function()
     //        {
     //           var zongjia = document.getElementById("zongz").innerHTML;
                
     //           var jsonData = {"zongjia":zongjia}; //转化为json格式
     //           window.name = JSON.stringify(jsonData); //window.name只接受字符串格式，所以需要把json转换一下

     //           window.location = "/zhifu/tijiao"; //跳转到b页面
     //        }
     //       )
     //});
     

 </script>